Skip to content

Fix #14809 FP syntaxError for typedef involving std::size_t#8618

Open
chrchr-github wants to merge 3 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_14809
Open

Fix #14809 FP syntaxError for typedef involving std::size_t#8618
chrchr-github wants to merge 3 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_14809

Conversation

@chrchr-github

@chrchr-github chrchr-github commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

size_t is a platform type and will be simplified anyway, this is tested here:

void simplifyPlatformTypes() {

@chrchr-github chrchr-github marked this pull request as ready for review June 2, 2026 18:01
Comment thread test/testtoken.cpp
@@ -1488,8 +1487,6 @@ class TestToken : public TestFixture {
TokenList list_c{settingsDefault, Standards::Language::C};
auto tokensFrontBack = std::make_shared<TokensFrontBack>();
Token tok(list_c, std::move(tokensFrontBack));
tok.str("size_t"); // not treated as keyword in TokenList::isKeyword()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no assertion so this whole block of code seems redundant now. but would it be a good idea to keep the assertion and ensure that std is false instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size_t will be simplified, so testing the token's properties has no purpose. I'll remove the code blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants